package kaizen;

// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 07/02/2013 05:30:33 p.m.
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   Traza.java

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.sql.Date;

public class Traza
{

    public Traza()
    {
    }

    public static void addLog(String s, String s1, int i)
    {
        java.util.Date date = new java.util.Date(System.currentTimeMillis());
        String s2 = "";
        switch(i)
        {
        case 1: // '\001'
            s2 = date.toLocaleString();
            break;

        case 2: // '\002'
            s2 = "" + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
            break;

        default:
            s2 = date.toLocaleString();
            break;
        }
        if(s1.equalsIgnoreCase(""))
            toFile(s, " ");
        else
            toFile(s, "<" + s2 + "> " + s1);
    }

    public static void addLog(String s, String s1)
    {
        Date date = new Date(System.currentTimeMillis());
        String s2 = date.toLocaleString();
        toFile(s, "<" + s2 + "> " + s1);
    }

    private static void toFile(String s, String s1)
    {
        try
        {
            BufferedWriter bufferedwriter = new BufferedWriter(new FileWriter(s + "mike.txt", true));
            bufferedwriter.write(s1 + "\n");
            bufferedwriter.close();
        }
        catch(IOException ioexception)
        {
            System.err.println(ioexception.getMessage());
        }
    }

    public static String rellenaIzquierda(String s, int i, String s1)
    {
        s = s.trim();
        int j = s.length();
        for(int k = j; k < i; k++)
            s = s1 + s;

        return s;
    }

    public static String rellenaDerecha(String s, int i, String s1)
    {
        s = s.trim();
        int j = s.length();
        for(int k = j; k < i; k++)
            s = s + s1;

        return s;
    }
}